/*
 * activity.cpp
 *
 *  Created on: Jul 21, 2010
 *      Author: nintang
 */

#include "activityall.h"

activityall::activityall(QWidget *parent)
    : QWidget(parent)
{
	//setWindowFlags(Qt::WindowSoftkeysVisibleHint);
	QLabel *labelActivityAll=new QLabel(this);
	labelActivityAll->setGeometry(QRect(0,0, 360, 53));
	labelActivityAll->setStyleSheet("background-image: url(:/images/32.png);");
	QListWidget *listWidget=new QListWidget(this);
	listWidget->setFixedWidth(360);
	listWidget->setMinimumHeight(528);
	listWidget->move(0,53);
	listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	listWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
	QListWidgetItem *listitem1=new QListWidgetItem(listWidget);
	listitem1->setSizeHint(QSize(360,140)); 
	activitylist *activitylist1=new activitylist(1,0);
	listWidget->setItemWidget(listitem1,activitylist1);
	QListWidgetItem *listitem2=new QListWidgetItem(listWidget);
	listitem2->setSizeHint(QSize(360,140)); 
	activitylist *activitylist2=new activitylist(2,0);
	listWidget->setItemWidget(listitem2,activitylist2);	
	QListWidgetItem *listitem3=new QListWidgetItem(listWidget);
	listitem3->setSizeHint(QSize(360,140)); 
	activitylist *activitylist3=new activitylist(3,0);
	listWidget->setItemWidget(listitem3,activitylist3);
	QListWidgetItem *listitem4=new QListWidgetItem(listWidget);
	listitem4->setSizeHint(QSize(360,140)); 
	activitylist *activitylist4=new activitylist(4,0);
	listWidget->setItemWidget(listitem4,activitylist4);	
	QListWidgetItem *listitem5=new QListWidgetItem(listWidget);
	listitem5->setSizeHint(QSize(360,140)); 
	activitylist *activitylist5=new activitylist(5,0);
	listWidget->setItemWidget(listitem5,activitylist5);	
	QListWidgetItem *listitem6=new QListWidgetItem(listWidget);
	listitem6->setSizeHint(QSize(360,140)); 
	activitylist *activitylist6=new activitylist(6,0);
	listWidget->setItemWidget(listitem6,activitylist6);	
	connect(listWidget, SIGNAL(itemClicked(listWidget->item(1))), this, SLOT(openactivityview()));
	//back = new QAction(tr("Back"), this);
	//back->setSoftKeyRole(QAction::NegativeSoftKey);
	//connect(back, SIGNAL(triggered()), this, SLOT(backtobloghomepage()));
	//addAction(back);		
	QPushButton *pushButtonRight=new QPushButton(this);
	pushButtonRight->setGeometry(QRect(0, 580, 180, 60));	
	pushButtonRight->setStyleSheet("border-image:url(:/images/56.png);border:0px;");
	QPushButton *pushButtonLeft=new QPushButton(this);
	pushButtonLeft->setGeometry(QRect(180, 580, 180, 60));	
	pushButtonLeft->setStyleSheet("border-image:url(:/images/57.png);border:0px;");
	connect(pushButtonLeft, SIGNAL(clicked()), this, SLOT(backtobloghomepage()));		
}

activityall::~activityall()
{

}
void activityall::backtobloghomepage()
{
    bloghomepage *w=new bloghomepage(2,0);
    w->showFullScreen(); 
    this->~activityall();
}
void activityall::openactivityview()
{
	//this->~activityall();
    activityview *w=new activityview();
    w->showFullScreen(); 
    this->hide();
}
